﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProvaBD
{
    public partial class AgregarUsuari : Form
    {
        public AgregarUsuari()
        {
            InitializeComponent();
        }

        private void btnInser_Click(object sender, EventArgs e)
        {
            try
            {
                afegirAlumne();
            }
            catch (Exception er)
            {
                MessageBox.Show("Fallo");
            }
            this.Close();

        }
        private void afegirAlumne()
        {
            AlumneConversor a = new AlumneConversor();
            a.propertyNom = txtNom.Text;
            a.propertyCognom = txtCog.Text;
            a.propertyTelefon = txtTel.Text;
            a.agregarAlumne();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
